<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: delete_option.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

$options = $db->db_query("SELECT
								products_options_id,
								products_options_name
							FROM
								".TABLE_PRODUCTS_OPTIONS."
							WHERE
								products_options_id = '".$_GET['option_id']."'
							AND
								language_id = '".$_SESSION['languages_id']."'");
?>

<h3><?php echo $options->fields['products_options_name']; ?></h3>

<table width="100%" cellpadding="2">
	<?php
		$products = $db->db_query("SELECT
										p.products_id,
										pd.products_name,
										pov.products_options_values_name
									FROM
										".TABLE_PRODUCTS." p,
										".TABLE_PRODUCTS_OPTIONS_VALUES." pov,
										".TABLE_PRODUCTS_ATTRIBUTES." pa,
										".TABLE_PRODUCTS_DESCRIPTION." pd
									WHERE
										pd.products_id = p.products_id
									AND
										pov.language_id = '".$_SESSION['languages_id']."'
									AND
										pd.language_id = '".$_SESSION['languages_id']."'
									AND
										pa.products_id = p.products_id
									AND
										pa.options_id='".$_GET['option_id']."'
									AND
										pov.products_options_values_id = pa.options_values_id
									ORDER BY
										pd.products_name");
		if($products->_numOfRows) { ?>
			<tr class="dataTableHeadingRow">
				<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ID; ?></td>
				<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT; ?></td>
				<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_OPT_VALUE; ?></td>
			</tr>
			<?php
			while(!$products->EOF) { $rows++;
				?>
				<tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
					<td align="center"><?php echo $products->fields['products_id']; ?></td>
					<td><?php echo $products->fields['products_name']; ?></td>
					<td><?php echo $products->fields['products_options_values_name']; ?></td>
				</tr>
				<?php
				$products->MoveNext();
			}	?>
			<tr>
				<td colspan="3"><br />
					<?php echo TEXT_WARNING_OF_DELETE; ?>
				</td>
			</tr>
			<tr>
				<td align="right" colspan="3"><br />
					<?php echo button_link(BUTTON_CANCEL, href_link(FILENAME_PRODUCTS_ATTRIBUTES, getmenuID('products_attributes').'&'.$opt_add));?>
				</td>
			</tr>
		<?php } else { ?>
		<tr>
			<td colspan="3"><br />
				<?php echo TEXT_OK_TO_DELETE; ?>
			</td>
		</tr>
		<tr>
			<td align="right" colspan="3"><br />
				<?php echo button_link(BUTTON_DELETE, href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_option&'.getmenuID('products_attributes').'&option_id='.$_GET['option_id'].$opt_add));?>
				
				<?php echo button_link(BUTTON_CANCEL, href_link(FILENAME_PRODUCTS_ATTRIBUTES, getmenuID('products_attributes').'&'.$opt_add));?>
			</td>
		</tr>
		<?php
		}
		?>
	</table>